/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package client.dal;

import client.entity.Location;
import java.util.ArrayList;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import util.HibernateUtil;

/**
 *
 * @author mrlucky
 */
public class LocationDAL {

    public LocationDAL() {
    }
    
    public ArrayList<Location> listLoca() {
        SessionFactory sf = HibernateUtil.getSessionFactory();
        Session ss = sf.openSession();
        ss.beginTransaction().begin();
        ArrayList<Location> list = (ArrayList<Location>) ss.createQuery("from Location l").list();
        ss.beginTransaction().commit();
        ss.close();
        return list;
    }
}
